* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 80px;
}

/* 商品轮播区域 */
.product-carousel {
    width: 100%;
    background-color: #d4b5d4;
    position: relative;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

.carousel-item.active {
    display: flex;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.indicator.active {
    background-color: #fff;
    width: 24px;
    border-radius: 4px;
}

/* 商品信息区域 */
.product-info {
    padding: 20px;
    background-color: #fef9f3;
}

.product-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
}

.price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.discount-price {
    font-size: 28px;
    font-weight: bold;
    color: #e4393c;
}

.original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

.login-tip {
    font-size: 12px;
    color: #999;
    line-height: 1.5;
    white-space: nowrap;
}

.login-link {
    color: #e4393c;
    text-decoration: none;
    font-weight: bold;
}

.login-link:hover {
    text-decoration: underline;
}

/* 团购列表区域 */
.group-buy-section {
    padding: 15px;
    flex: 1;
}

/* 空团购列表卡片 */
.empty-team-card {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
}

.empty-team-text {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

.group-buy-item {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.group-leader {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 12px;
}

.leader-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.leader-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.leader-info {
    flex: 1;
}

.leader-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
}

.group-status {
    font-size: 13px;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-text {
    line-height: 1.4;
}

.remaining-count {
    color: #e4393c;
    font-weight: bold;
}

.countdown {
    color: #e4393c;
    font-weight: bold;
    font-size: 14px;
}

.join-group-btn {
    background: linear-gradient(135deg, #e4393c 0%, #d32f2f 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(228, 57, 60, 0.3);
}

.join-group-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(228, 57, 60, 0.4);
}

.join-group-btn:active {
    transform: translateY(0);
}

/* 底部购买按钮 */
.bottom-actions {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: 100%;
    display: flex;
    gap: 0;
    background-color: #fff;
    padding: 12px 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.buy-alone-btn,
.buy-group-btn {
    flex: 1;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.buy-alone-btn {
    background: linear-gradient(135deg, #ffb347 0%, #ff9933 100%);
    color: #fff;
    border-radius: 25px 0 0 25px;
}

.buy-group-btn {
    background: linear-gradient(135deg, #e4393c 0%, #d32f2f 100%);
    color: #fff;
    border-radius: 0 25px 25px 0;
}

.buy-alone-btn:hover,
.buy-group-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.buy-alone-btn:active,
.buy-group-btn:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        max-width: 100%;
    }

    .bottom-actions {
        max-width: 100%;
    }
}

/* ==================== 支付弹窗样式 ==================== */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.payment-modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1001;
}

.modal-content {
    position: relative;
    z-index: 1002;
    background-color: #fff;
    border-radius: 20px;
    padding: 30px 25px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 15px;
}

.payment-amount {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin-bottom: 25px;
}

.payment-amount span {
    font-size: 20px;
    font-weight: bold;
    color: #e4393c;
    margin: 0 5px;
}

.qrcode-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 30px;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.cancel-btn,
.confirm-btn {
    flex: 1;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s;
}

.cancel-btn {
    background-color: #666;
    color: #fff;
}

.cancel-btn:hover {
    background-color: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 102, 102, 0.4);
}

.confirm-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: #fff;
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.cancel-btn:active,
.confirm-btn:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 480px) {
    .modal-content {
        padding: 25px 20px;
    }

    .modal-title {
        font-size: 20px;
    }

    .payment-amount {
        font-size: 14px;
    }

    .payment-amount span {
        font-size: 18px;
    }

    .qrcode-container {
        padding: 15px;
    }

    .cancel-btn,
    .confirm-btn {
        padding: 12px 16px;
        font-size: 15px;
    }
}